class_name monster_base  extends Node2D

var _monId:int = 0;
# Called when the node enters the scene tree for the first time.
func _ready():
	var aniNames = $AnimatedSprite2D.sprite_frames.get_animation_names();
	$AnimatedSprite2D.play(aniNames[randi() % aniNames.size()]);


# Called every frame. 'delta' is the elapsed time since the previous frame.
func _process(delta):
	pass
	
func Init(monId):
	_monId = monId;
	$AnimatedSprite2D.sprite_frames = load("res://game_resources/monster/1001/monster_100%d.tres" % monId)
	
	
	
func Dead():
	print("怪物死亡 "+ String.num(_monId));


#func _on_area_entered(area):
	#print("monsterbase:_on_area_entered")


#func _on_body_entered(body):
	#print("_on_body_entered")


#func _on_area_shape_entered(area_rid, area, area_shape_index, local_shape_index):
	#print("_on_area_shape_entered")
